<div class="header">
    <div class="header-tab flex">
        <span class="header-btn" ng-class="{active:chatIndex.curTab==1}" ng-click="chatIndex.switchTab(1)">
        消息
    </span>
        <span class="header-btn" ng-class="{active:chatIndex.curTab==2}" ng-click="chatIndex.switchTab(2)">
        群组
    </span>
    </div>
    <div class="right-btn flex">
        <div class="icon_search" ng-click="chatIndex.showSearch()"></div>
        <div class="ml10 cross_wrapper" ng-click="chatIndex.showMore()">
            <div class="cross_icon"></div>
        </div>
    </div>
    <div class="showMore lh30 fs14" ng-show="chatIndex.isShowMore">
        <ul>
            <li ng-click="chatIndex.createDiscussConfirm()">发起聊天</li>
            <!--<li ng-click="chatIndex.createGroupConfirm()">新建群组</li>-->
            <li ng-click="chatIndex.removeUsers()">{{chatIndex.showdel?"完成":"移除会话"}}</li>
        </ul>
    </div>
</div>
<div class="container" style="bottom: 50px" ng-touchstart="chatIndex.hidemore()" ng-hide="chatIndex.isShowSearch">
    <div class="list list-menu list-msg" ng-class="{showdel:chatIndex.showdel}" ng-show="chatIndex.curTab==1">
        <div class="list-item grid celled" ng-repeat="item in chatIndex.friends" on-long-press="chatIndex.itemOnLongPress($index,item)">
            <!-- 最后一个不加边框 -->
            <div class="btn-delete c1 tc" ng-click="chatIndex.itemOnLongPress($index,item)"></div>
            <div class="flex" ng-click="chatIndex.goChatRoom(item.targetId,item.conversationType)">
                <div class="list-item-content w20" ng-class="{celled:menulist[$index+1]}" ng-switch="item.conversationType">
                    <div ng-switch-when="PRIVATE" class="item-avtar tc lh50">
                        <img err-src="images/404.png" ng-src={{item.targetId|chatfilterImg|avtarfilter}} ng-if="item.targetId|chatfilterImg|avtarfilter">{{item.targetId | chatfilterName}}
                    </div>
                    <div ng-switch-when="GROUP">
                        <img src='./images/group.png'>
                    </div>
                </div>
                <div class="list-item-content w80">
                    <div class="list-item-title fw">{{item|titleFiter}}</div>
                    <div class="list-item-tip fs12 te" ng-bind-html="item.latestMessage"></div>
                    <div class="list-item-num fs12 tc c1 lh25" ng-hide="item.unreadMessageCount == '0'">{{item.unreadMessageCount}}</div>
                </div>
            </div>
        </div>
    </div>
    <div class="list" ng-show="chatIndex.curTab==2">
        <div class="list-item flex celled" ng-repeat="group in chatIndex.groups" ng-click="chatIndex.goChatRoom(group.pkId,'GROUP')">
            <div class="w15 user-avatar">
                <img src='./images/icon_rs.png'>
            </div>
            <div class="w85 lh50">
                <h2 class="te">{{group.groupName}}({{group.numberOfUser}})</h2>
            </div>
        </div>
    </div>
</div>
<div class="container" style="bottom: 50px" ng-show="chatIndex.isShowSearch">
    <input type="text" id="searchInput" class="search_input" ng-model="chatIndex.search" ng-blur="chatIndex.hidesearch()">
    <div class="people-list" ng-show="chatIndex.search">
        <div ng-repeat="dep in chatIndex.contactInfo|filter:chatIndex.search">
            <p class="list-item">{{dep.name}}</p>
            <div class="list-item" ng-repeat="item in dep.children|filter:chatIndex.search track by item.id">
                <label class="celled flex lh50" ng-click="chatIndex.goPrivate(item.id)">
                    <div class="list-item-userpic w25">
                        <div class="item-avtar tc"><img err-src="images/404.png" ng-src={{item.iconCls|avtarfilter}} alt="" ng-if="item.iconCls">{{(item.name| username)}}</div>
                    </div>
                    <div class="list-item-content w75 cl">
                        <div class="list-item-title fw fl">{{item.name}} ({{item.text}})</div>
                    </div>
                </label>
            </div>
        </div>
    </div>
</div>
<div app-footer active="talk"></div>